using Ardalis.Specification;

namespace Domain.Todos.Specifications;

/// <summary>
/// 已完成待办事项规约
/// </summary>
public sealed class CompletedTodosSpecification : Specification<TodoItem>
{
    public CompletedTodosSpecification(Guid userId)
    {
        Query.Where(todo => todo.UserId == userId && todo.IsCompleted)
             .OrderByDescending(todo => todo.CompletedAt);
    }
}